<?php

namespace app\pc\behavior;

use think\Cache;
use think\Session;
use think\Config;

class Auth
{

    public function run(&$params)
    {

        $modeule = strtolower($params->module());
        //当前控制器名称
        $controller = strtolower($params->controller());
        //当前操作名称
        $action = strtolower($params->action());
        $actions = $modeule."/".$controller."/".$action;

        $arrAut = ["pc/pcsite/index","pc/pcsite/save"];

        if(!in_array($actions,$arrAut)){
            $sid = $params->param("sid");
            if(!empty($sid)){
                w_s("sid",$sid);
            }

            if(!Cache::has($sid)){
                exit(json_encode(resJson(102,"请重新登录")->getData()));
            }
        }




    }

}
